//package com.caiyi.financial.nirvana.sms.scheduled;
//
//import com.caiyi.financial.nirvana.sms.service.SmsMsgService;
//import com.caiyi.financial.nirvana.sms.util.AlarmUtil;
//import com.caiyi.financial.nirvana.sms.util.Constant;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Component;
//
///**
// * @Description:
// * @author:zhaocc
// * @date 2018/10/911:42
// */
//@Component
//public class AlarmTask {
//    private static final Logger logger = LoggerFactory.getLogger(AlarmTask.class);
//    @Autowired
//    private SmsMsgService smsMsgService;
//    @Value("${spring.profiles.active}")
//    private String env;
//
//    @Scheduled(fixedRate = Constant.TEN_MINUTES_OF_SECOND * 300, initialDelay = Constant.TEN_MINUTES_OF_SECOND * 300)
//    public void msgCount() {
//        try {
//            long count = smsMsgService.countSmsMsg();
//            if (count == 0) {
//                if (Constant.ENV_PRO.equals(env)) {
//                    AlarmUtil.sendAlarmSms();
//                }
//                logger.info("验证码短信严重告警，3分钟之内没有短信发送记录，请注意查看！！！");
//            }
//        } catch (Exception e) {
//            logger.error("AlarmTask msgCount error", e);
//        }
//    }
//}
